<template>
    <div id="login">
        <div class="login">
            <div class="logo">
                <img src="@/assets/login/login.png">
            </div>
            <div class="denglu" @click="goSign()">{{$t('lang.login')}}</div>
            <div class="zhuce" @click="goRegister()">{{$t('lang.register')}}</div>
        </div>
        <div class="languageChange">
            <a href="javascript:void(0);" @click="changeMode">简体中文</a>
          <span>|</span>
          <a href="javascript:void(0);" @click="changeMode">English</a>
        </div>
    </div>
</template>

<script>
    export default {
        name: "index",
        methods: {
            goSign() {
                this.$router.push('/sign')
            },
            goRegister() {
                this.$router.push('/register')
            },
            changeMode(){
                console.log(this.$i18n.locale);
                let lang = this.$i18n.locale === 'zh' ? 'en' : 'zh';
                this.$i18n.locale = lang;
            }
        },
        data(){
          return{
            lang:'zh'
          }
        }
    }
</script>

<style lang="scss" scoped>
#login {
    display: flex;
    justify-content: center;
    height: 50vh;
    margin: 25vh 0;
}
.login {
    flex-wrap: wrap;
    > div {
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .logo {
        width: 400px;
        height: 400px;
        > img {
            width: 100%;
            height: 100%;
        }
    }
}
.languageChange{
  position: absolute;
  top: 50px;
  right: 50px;
  color: black;
  font-size: 30px;
  a{
    padding: 10px;
    text-decoration: underline;
  }
}
.denglu, .zhuce {
    height: 90px;
    font-size: 30px;
    margin-top: 20px;
    color: #fff;
    border-radius: 50px;
}
.denglu {
    background-color: #ff6700;
}
.zhuce {
    background-color: #00c6ff;
}
</style>